import request from "@/utils/request";

// API 服务详情
export function getApiDetail(apiVsersionId) {
    return request({
        url: `/system/servePool/detail/${apiVsersionId}`,
        method: "get"
    });
}

// API 历史版本
export function getApiHistory(apiVsersionId) {
    return request({
        url: `/system/servePool/historyVersion/${apiVsersionId}`,
        method: "get"
    });
}

// 接口调用
export function invokeApi(params) {
    return request({
        url: `/system/servePool/invokeApi`,
        method: "get",
        params
    });
}

// 接口调用历史
export function invokeApiHistory(apiVsersionId, params) {
    return request({
        url: `/system/servePool/invokeHistory/${apiVsersionId}`,
        method: "get",
        params
    });
}

// 数据服务列表
export function getServerList(data, params = {}) {
    return request({
        url: `/system/servePool/list`,
        method: "post",
        params,
        data,
        injectParmas: true
    });
}

// 该接口服务订阅使用人
export function getApiSubcribeList(apiVsersionId, params) {
    return request({
        url: `/system/servePool/subcribeUserCount/${apiVsersionId}`,
        method: "get",
        params
    });
}

// 接口试用
export function tryInvokeApi(params) {
    return request({
        url: "/system/servePool/tryInvokeApi",
        method: "get",
        params
    });
}

// 接口试用历史
export function tryInvokeApiHistoryList(params) {
    return request({
        url: "/system/servePool/tryInvokeApiHistoryList",
        method: "get",
        params
    });
}

// 接口试用列表
export function tryInvokeApiList(params) {
    return request({
        url: "/system/servePool/tryInvokeApiList",
        method: "get",
        params
    });
}
